package the.broccoli.setting.configuration;

import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.wisteria.framework.web.ExceptionMessage;
import the.broccoli.setting.service.ILanguageService;

import javax.annotation.Resource;

/**
 * 多语言
 */
//@Configuration
public class LanguageConfiguration {

    @Resource
    private ILanguageService languageService;


    @ConditionalOnExpression("${broccoli.setting.exception-mssage.db:true}")
    @Bean
    public ExceptionMessage exceptionMessage() {
        return new LanguageExceptionMessage(languageService);
    }
}
